package bookstore.database.pojo;

/**
 * OrderDetailId entity. @author MyEclipse Persistence Tools
 */

public class OrderDetailId implements java.io.Serializable {

	// Fields

	private Orders orders;
	private Book book;

	// Constructors

	/** default constructor */
	public OrderDetailId() {
	}

	/** full constructor */
	public OrderDetailId(Orders orders, Book book) {
		this.orders = orders;
		this.book = book;
	}

	// Property accessors

	public Orders getOrders() {
		return this.orders;
	}

	public void setOrders(Orders orders) {
		this.orders = orders;
	}

	public Book getBook() {
		return this.book;
	}

	public void setBook(Book book) {
		this.book = book;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof OrderDetailId))
			return false;
		OrderDetailId castOther = (OrderDetailId) other;

		return ((this.getOrders() == castOther.getOrders()) || (this
				.getOrders() != null && castOther.getOrders() != null && this
				.getOrders().equals(castOther.getOrders())))
				&& ((this.getBook() == castOther.getBook()) || (this.getBook() != null
						&& castOther.getBook() != null && this.getBook()
						.equals(castOther.getBook())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getOrders() == null ? 0 : this.getOrders().hashCode());
		result = 37 * result
				+ (getBook() == null ? 0 : this.getBook().hashCode());
		return result;
	}

}